/*
 * Copyright 2007-2008, www.jsemantic.org, www.adolfoestevez.com,
 * http://semanticj2ee.blogspot.com/ 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jservicerules.support.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * This class contains different methods to create a Spring context.
 */
public class SpringContextFactory {
	
	/**
	 * Creates a Spring context using a xml file.
	 * 
	 * @param file the location of the xml context file  using the class path notation.
	 * 
	 * @return the class path application context factory
	 */
	public static ApplicationContext getClassPathApplicationContexFactory(
			String file) {
		return new ClassPathXmlApplicationContext(file);
	}
	
	/**
	 * Gets the class path application contex factory.
	 * 
	 * @param files the location of the xml context files using the class path notation.
	 * 
	 * @return the class path application contex tfactory
	 */
	public static ApplicationContext getClassPathApplicationContexFactory(
			String[] files) {
		return new ClassPathXmlApplicationContext(files);
	}
	
}
